package com.ksyun.campus.metaserver.domain.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import jakarta.validation.constraints.NotBlank;

/**
 * Open file request
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class OpenRequest {
    
    @NotBlank(message = "Path cannot be blank")
    private String path;
    
    @NotBlank(message = "Mode cannot be blank")
    private String mode; // READ or WRITE
    
    public enum OpenMode {
        READ, WRITE
    }
    
    public OpenMode getOpenMode() {
        return OpenMode.valueOf(mode.toUpperCase());
    }
}
